//
//  ViewController.m
//  cyclePrac
//
//  Created by 张Kevin on 17/5/30.
//  Copyright © 2017年 Kevin. All rights reserved.
//

#import "ViewController.h"
#import "LLCycleView.h"

@interface ViewController ()<LLCycleViewDelegate,LLCycleViewDataSource>


@property (nonatomic, strong) LLCycleView *testView;


@end

@implementation ViewController

-(LLCycleView *)testView{
    
    
    LLCycleView *testView = [[LLCycleView alloc]initWithFrame:CGRectMake(0, 0, 375, 300)];
    [self.view addSubview:testView];
    
//    testView.backgroundColor = [UIColor orangeColor];
    
    testView.delegate = self;
    testView.dataSource = self;
    
    return testView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self.testView reloadData];


}



- (NSInteger)numberOfRowsInCycleView:(LLCycleView * )cycleView{
    
    return 5;
}

-(NSURL *)cycleView:(LLCycleView *)cycleView imageURLForItemAtIndex:(NSInteger )index{
    
    NSArray *urlArray = @[@"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1496213153130&di=b2c03b176cf0a7ad897d5f654ba873de&imgtype=0&src=http%3A%2F%2Fimg2.3lian.com%2F2014%2Ff3%2F53%2Fd%2F107.jpg",@"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1496213153129&di=9d68034d474b42569a6302d84223faae&imgtype=0&src=http%3A%2F%2Fimg3.duitang.com%2Fuploads%2Fitem%2F201606%2F14%2F20160614131733_CZBhM.jpeg",
                          @"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1496213153129&di=1299dda8b2eea0a4269cadcb4ec7774c&imgtype=0&src=http%3A%2F%2Fimg.sc115.com%2Fuploads%2Fsc%2Fjpgs%2F0519apic3677_sc115.com.jpg",
                          @"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1496213153129&di=fe074783d8492eb796a3ec501463b315&imgtype=0&src=http%3A%2F%2Fpic1.cxtuku.com%2F00%2F11%2F37%2Fb112b0ec9230.jpg",
                          @"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1496213153129&di=7f1bc974cf3f1aacacd1b18eaa1ec6ed&imgtype=0&src=http%3A%2F%2Fimgsrc.baidu.com%2Fforum%2Fmpic%2Fitem%2Fc9a591230e3eb672ac34dee8.jpg",
                          @"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1496213153128&di=a84e08a9afe799811f9c86cda2c86663&imgtype=0&src=http%3A%2F%2Fc.hiphotos.baidu.com%2Fzhidao%2Fpic%2Fitem%2F86d6277f9e2f070832abe952e124b899a901f232.jpg"];
    
    return urlArray[index];
}
//-(UIColor *)colorForCurrentPageInCycleView:(LLCycleView *)cycleView{
//    
//    return [UIColor greenColor];
//}






@end
